<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="项目报备申请表" libs=["table"]/>
<style>
    table.table-form-title{margin:20px auto 0;}
    table.table-form-title td{text-align: center;border-bottom:0 !important;}
    table.table{width:90%;margin:0 auto;}
    table.table-form-attach{margin-bottom:100px;}
</style>
<div class="row">
    <table class="table-form-title table" style="margin-top:20px;">
        <tr>
            <td colspan="4" style="border-bottom: 0 !important;">
                <h2>湖南鑫湘物探工程有限公司</h2>
                <h2>项目报备申请表</h2>
            </td>
        </tr>
        <tr>
            <td width="15%" colspan="2">
                <button name="aaaa" class="btn btn-primary btn-rounded btn-sm">项目名称查重
                </button>
                <div style="display: none;">
                    <@f.tableselect name="selectuser222" boxTitle="多选用户信息" required=false checked=false tableInfo = "[{field:'username',title:'账号'},{field:'name',title:'姓名',query: true},{field:'compName',title:'归属公司'},
                    {field:'deptName',title:'归属机构'},{field:'email',title:'邮箱'},{field:'mobile',title:'手机号码'},
                    {field:'status',title:'状态',dict:'sys_user_show_hide',query: true},{field:'createTime',title:'创建时间'}]" />
                </div>
            </td>
            <td class="text-left" colspan="2">
                <span>项目档案编号：</span>
            </td>
        </tr>
    </table>
    <table class="table-form-head table table-hover table-bordered">
        <tr>
            <th>发起人</th>
            <td>
                <div class="form-group">
                    <div class="col-sm-10">
                        <@f.tableselect name="selectuser2" boxTitle="多选用户信息" tableInfo = "[{field:'username',title:'账号'},{field:'name',title:'姓名',query: true},{field:'compName',title:'归属公司'},
                        {field:'deptName',title:'归属机构'},{field:'email',title:'邮箱'},{field:'mobile',title:'手机号码'},
                        {field:'status',title:'状态',dict:'sys_user_show_hide',query: true},{field:'createTime',title:'创建时间'}]"  placeholder="表格弹出式页面，实用于大数据，搜索选择，" />
                        <div id="c_tableselect2" class="panel-collapse collapse"></div>
                    </div>
                </div>
            </td>
            <th>发起时间</th>
            <td>
                <div class="form-group">
                    <div class="col-sm-8">
                        <@f.input name="date" type="date" dataType="datetime" dataFormat="yyyy-MM-dd HH:mm:ss"
                        placeholder="请选择时间"  butClass="fa fa-calendar-plus-o" required=true />
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <th>项目经理</th>
            <td>
                <div class="form-group">
                    <div class="col-sm-10">
                        <@f.tableselect name="selectuser" boxTitle="多选用户信息" tableInfo = "[{field:'username',title:'账号'},{field:'name',title:'姓名',query: true},{field:'compName',title:'归属公司'},
                        {field:'deptName',title:'归属机构'},{field:'email',title:'邮箱'},{field:'mobile',title:'手机号码'},
                        {field:'status',title:'状态',dict:'sys_user_show_hide',query: true},{field:'createTime',title:'创建时间'}]"  placeholder="表格弹出式页面，实用于大数据，搜索选择，" />
                        <div id="c_tableselect" class="panel-collapse collapse"></div>
                    </div>
                </div>
            </td>
            <th>所属部门</th>
            <td>
                <div class="form-group">
                    <div class="col-sm-10">
                        <@f.treeselect name="compId" boxTitle="请选择归属机构" url="sys/comp/treeData"
                        expandLevel=true placeholder="请选择上级机构"/>
                        <div id="c_treeselect" class="panel-collapse collapse"></div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <table class="table-form-body table table-hover table-bordered">
        <thead>
        <tr>
            <td colspan="3">
                <button name="btn-insert" class="btn btn-primary btn-rounded btn-sm">插入行</button>
                <button name="btn-copy" class="btn btn-primary btn-rounded btn-sm">复制行</button>
                <button name="btn-del" class="btn btn-primary btn-rounded btn-sm">删除行</button>
                <button name="btn-del-all" class="btn btn-primary btn-rounded btn-sm">删除全部</button>
                <button name="btn-import" class="btn btn-primary btn-rounded btn-sm">导入数据</button>
            </td>
        </tr>
        <tr>
            <th width="10%">序号</th>
            <th>分类</th>
            <th>项目类别</th>
        </tr>
        </thead>
        <tbody>
            <tr>
                <td><span>1</span></td>
                <td><@f.input name="type_1" placeholder="请输入项目名称" required=true/></td>
                <td><@f.input name="pro_1" placeholder="请输入项目名称" required=true/></td>
            </tr>
        </tbody>
    </table>
    <table class="table-form-foot table table-hover table-bordered">
        <tr>
            <td width="20%">项目名称</td>
            <td width="80%" colspan="3">
                <div class="col-sm-10">
                    <@f.input name="username1" placeholder="请输入项目名称" required=true/>
                </div>
            </td>
        </tr>
        <tr>
            <td>合同甲方(委托单位)</td>
            <td colspan="3">
                <div class="col-sm-10">
                    <@f.input name="username2" placeholder="请输入合同甲方" required=true/>
                </div>
            </td>
        </tr>
        <tr>
            <td>工程地址</td>
            <td colspan="3">
                <div class="col-sm-10">
                    <@f.input name="username3" placeholder="请输入工程地址" required=true/>
                </div>
            </td>
        </tr>
        <tr>
            <td width="20%">有无地灾施工</td>
            <td width="30%">
                <div class="form-group">
                    <div class="col-sm-8">
                        <@f.radio name="type" dictType="sys_geo_hazard"/>
                    </div>
                </div>
            </td>
            <td width="20%">项目状态</td>
            <td width="30%">
                <@f.select name="status" dictType="sys_pro_status" blankValue="" blankLabel="所有"/>
            </td>
        </tr>
        <tr>
            <td>处理意见</td>
            <td colspan="3">
                <div class="col-sm-10">
                    <@f.input name="username" placeholder="请输入处理意见" required=true/>
                </div>
            </td>
        </tr>
        <tr>
            <td>备注</td>
            <td colspan="3"></td>
        </tr>
    </table>
    <table class="table-form-attach table">
        <tr>
            <td width="10%" style="border-bottom: 0 !important;">发起人部门</td>
            <td colspan="3" style="border-bottom: 0 !important;">
                <div class="col-sm-10">
                    <@f.treeselect name="compId2" boxTitle="请选择归属机构" url="sys/comp/treeData"
                    expandLevel=true placeholder="请选择上级机构"/>
                    <div id="c_treeselect221" class="panel-collapse collapse"></div>
                </div>
            </td>
        </tr>
    </table>
</div>
<@footer>
<script type="text/javascript">
    $("button[name=aaaa]").click(function (e) {
        $("#selectuser222Name").click();
        //e.stopPropagation()
        console.log("aaaa")
    });

    $("button[name=btn-insert]").click(function () {
        var target = $(this).closest("table").find("tbody");
        var index = target.children().length + 1;
        var tpl = $(target.children().get(0)).prop("outerHTML");
        tpl = tpl.replaceAll("1", index);
        target.append(tpl);
    });
    $("button[name=btn-del]").click(function () {
        var target = $(this).closest("table").find("tbody");
        var index = target.children().length - 1;
        if(index>0){
            target.children().get(index).remove();
        }
    });
    $("button[name=btn-del-all]").click(function () {
        var target = $(this).closest("table").find("tbody");
        var index = target.children().length - 1;
        for(var i=index; i>0; i--){
            target.children().get(i).remove();
        }
    });
</script>
</@footer>
</@pageTheme>